#include "../../include/core/CheckingAccount.h"
#include <string>

namespace MiniBanking
{

    CheckingAccount::CheckingAccount(const std::string &accountID, const std::string &ownerName, double initialBalance)
        : BankAccount(accountID, ownerName, initialBalance)
    {
    }

    std::string CheckingAccount::getAccountType() const
    {
        return "Checking Account";
    }

    bool CheckingAccount::canTransferTo(const BankAccount &destination) const
    {
        // Checking accounts can transfer to any account type.
        // We might add a check here later if destination is somehow invalid globally,
        // but based on the rules, the *type* restriction doesn't apply.
        // We just need to ensure the destination object itself is valid, which is
        // implicitly handled by receiving a valid reference.
        return true;
    }

    bool CheckingAccount::deposit(double amount)
    {
        if (amount <= 0.0)
        {
            return false; // Cannot deposit non-positive amount
        }
        increaseBalance(amount); // Call protected base class method
        return true;
    }

    bool CheckingAccount::withdraw(double amount)
    {
        // Call protected base class method which handles amount positivity check and balance check
        return decreaseBalance(amount);
    }

}